@extends('admin.main')
@section('body')
    <div class="main-title">
        <h2>{{isset($info['id']) ? '编辑':'新增'}}工人</h2>
    </div>
    <div class="tab-wrap">
        <div class="tab-content">
            <form action="" method="post" class="form-horizontal">
                <!-- 基础 -->
                <div id="tab1" class="tab-pane in tab1">
                    <div class="form-item">
                        <label class="item-label">
                            工号<span class="check-tips">（工号不能为空，必须为4-6位数字或字母）</span>
                        </label>
                        <div class="controls">
                            <input type="text" name="code" class="text input-large" placeholder="推荐字母+数字组合，可以有效避免重复"
                                   value="{{isset($info['code']) ? $info['code'] : ''}}">
                        </div>
                    </div>
                    <div class="form-item">
                        <label class="item-label">
                            姓名<span class="check-tips">（姓名不能为空）</span>
                        </label>
                        <div class="controls">
                            <input type="text" name="name" class="text input-large"
                                   value="{{isset($info['name']) ? $info['name'] : ''}}">
                        </div>
                    </div>
                    <div class="form-item">
                        <label class="item-label">
                            手机号<span class="check-tips">（手机号不能为空）</span>
                        </label>
                        <div class="controls">
                            <input type="text" name="mobile" class="text input-large"
                                   value="{{isset($info['mobile']) ? $info['mobile'] : ''}}">
                        </div>
                    </div>
                    <div class="form-item">
                        <label class="item-label">老客户导入权限<span class="check-tips"></span></label>
                        <div class="controls">
                            <label class="radio"><input type="radio" name="import_auth" value="1"
                                                        @if(isset($info['import_auth']) && $info['import_auth'] == 1) checked @endif>开启</label>
                            <label class="radio"><input type="radio" name="import_auth" value="0"
                                                        @if(!isset($info['import_auth']) ||  $info['import_auth'] == 0) checked @endif >关闭</label>
                        </div>
                    </div>
                    <div class="form-item">
                        <label class="item-label">水票充值权限<span class="check-tips"></span></label>
                        <div class="controls">
                            <label class="radio"><input type="radio" name="charge_auth" value="1"
                                                        @if(isset($info['charge_auth']) && $info['charge_auth'] == 1) checked @endif>开启</label>
                            <label class="radio"><input type="radio" name="charge_auth" value="0"
                                                        @if(!isset($info['charge_auth']) ||  $info['charge_auth'] == 0) checked @endif >关闭</label>
                        </div>
                    </div>
                    <div class="form-item">
                        <label class="item-label">零送水取桶权限<span class="check-tips"></span></label>
                        <div class="controls">
                            <label class="radio"><input type="radio" name="recover_auth" value="1"
                                                        @if(isset($info['recover_auth']) && $info['recover_auth'] == 1) checked @endif>开启</label>
                            <label class="radio"><input type="radio" name="recover_auth" value="0"
                                                        @if(!isset($info['recover_auth']) ||  $info['recover_auth'] == 0) checked @endif >关闭</label>
                        </div>
                    </div>
                    <div class="form-item">
                        <label class="item-label">人工下单权限<span class="check-tips"></span></label>
                        <div class="controls">
                            <label class="radio"><input type="radio" name="creat_order_auth" value="1"
                                                        @if(isset($info['creat_order_auth']) && $info['creat_order_auth'] == 1) checked @endif>开启</label>
                            <label class="radio"><input type="radio" name="creat_order_auth" value="0"
                                                        @if(!isset($info['creat_order_auth']) ||  $info['creat_order_auth'] == 0) checked @endif >关闭</label>
                        </div>
                    </div>
                    <div class="form-item">
                        <label class="item-label">订单改派权限<span class="check-tips"></span></label>
                        <div class="controls">
                            <label class="radio"><input type="radio" name="order_resend_auth" value="1"
                                                        @if(isset($info['order_resend_auth']) && $info['order_resend_auth'] == 1) checked @endif>开启</label>
                            <label class="radio"><input type="radio" name="order_resend_auth" value="0"
                                                        @if(!isset($info['order_resend_auth']) ||  $info['order_resend_auth'] == 0) checked @endif >关闭</label>
                        </div>
                    </div>
                    <div class="form-item">
                        <label class="item-label">
                            最大接单量<span class="check-tips">（最大接单量不能为空）</span>
                        </label>
                        <div class="controls">
                            <input type="text" name="max_order_num" class="text input-large"
                                   value="{{isset($info['max_order_num']) ? $info['max_order_num'] : 100}}">
                        </div>
                    </div>
                    @if(!isset($info))
                        <div class="form-item">
                            <label class="item-label"><span class="check-tips">默认登录密码：123456</span>
                            </label>
                        </div>
                    @endif
                <!-- 高级 -->
                    <div class="form-item">
                        <input type="hidden" name="id" value="{{isset($info['id']) ? $info['id'] : ''}}">
                        <input type="hidden" name="shop_id" value="{{isset($info['shop_id']) ? $info['shop_id'] : request('shop_id')}}">
                        <button type="submit" id="submit" class="btn submit-btn ajax-post"
                                target-form="form-horizontal">确 定
                        </button>
                        <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
                    </div>
            </form>
        </div>
    </div>
@endsection
